home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / IOInterface / deltaWindow.dcl < prev    next >
Encoding:
Modula Definition  |  1995-03-14  |  6.5 KB  |  161 lines  |  [TEXT/3PRM]

  1. definition module deltaWindow;
  2.  
  3. //    Version 0.8 to 1.0
  4.  
  5. //
  6. //    Operations on windows.
  7. //
  8.  
  9. import    deltaIOSystem, deltaPicture;
  10.  
  11. /*    Functions that operate on the active window are identical to the
  12.     functions that operate on a (list of) WindowId(s). If there are
  13.     no windows nothing happens.
  14.  
  15. OpenWindows    :: ![WindowDef s (IOState s)]    !(IOState s) -> IOState s;
  16.  
  17. /*    The windows are opened in the same order as they are specified
  18.     in the list of WindowDefs. If one of these windows has the
  19.     WindowId of an already open window the window is not opened.
  20.     Each new window becomes the frontmost, active window. */
  21.     
  22. CloseWindows        :: ![WindowId]            !(IOState s) -> IOState s;
  23. CloseActiveWindow    ::                        !(IOState s) -> IOState s;
  24.  
  25. /*    The windows are closed in the same order as in the list of id's. */
  26.  
  27. GetActiveWindow        :: !(IOState s) -> (!Bool, !WindowId, !IOState s);
  28.  
  29. /*    Returns True and the id of the active window if there is an
  30.     active window. If not, it returns False and WindowId 0. */
  31.  
  32. ActivateWindow        :: !WindowId            !(IOState s) -> IOState s;
  33.  
  34. /*    Activate the window with the indicated Id. If the window was
  35.     already active nothing happens. */
  36.  
  37. ChangeUpdateFunction        :: !WindowId !(UpdateFunction s)
  38.                                             !(IOState s) -> IOState s;
  39. ChangeActiveUpdateFunction    :: !(UpdateFunction s)
  40.                                             !(IOState s) -> IOState s;
  41.  
  42. /*    Change the update function of the indicated window. */
  43.  
  44. ChangeWindowTitle            :: !WindowId !WindowTitle !(IOState s) -> IOState s;
  45. ChangeActiveWindowTitle        ::             !WindowTitle !(IOState s) -> IOState s;
  46.  
  47. /*    Change the title of the indicated window. */
  48.  
  49. ChangeWindowCursor            :: !WindowId !CursorShape !(IOState s) -> IOState s;
  50. ChangeActiveWindowCursor    ::             !CursorShape !(IOState s) -> IOState s;
  51.  
  52. /*    Change the local cursor shape of a window. When the mouse pointer
  53.     moves over the content region (frame) of the window the cursor gets
  54.     the indicated shape. */
  55.  
  56. ::    ScrollBarChange
  57.     =    ChangeThumbs  Int Int    // Set horizontal and vertical thumb values
  58.     |    ChangeScrolls Int Int    // Set horizontal and vertical scroll values
  59.     |    ChangeHThumb  Int        // Set horizontal thumb value
  60.     |    ChangeVThumb  Int        // Set vertical thumb value
  61.     |    ChangeHScroll Int        // Set horizontal scroll value
  62.     |    ChangeVScroll Int        // Set vertical scroll value
  63.     |    ChangeHBar      Int Int    // Set horizontal thumb and scroll values
  64.     |    ChangeVBar      Int Int;    // Set vertical thumb and scroll values
  65.  
  66. ChangeScrollBar                :: !WindowId !ScrollBarChange
  67.                                     !s !(IOState s) -> (!s, !IOState s);
  68. ChangeActiveScrollBar        ::             !ScrollBarChange
  69.                                     !s !(IOState s) -> (!s, !IOState s);
  70.  
  71. /*    Change the values of the Thumbs and the Scrolls of the indicated window.
  72.     Illegal Thumb and Scroll values are adjusted to an acceptable value.
  73.     The function has no effect on FixedWindows. */
  74.  
  75. ChangePictureDomain            :: !WindowId !PictureDomain
  76.                                     !s !(IOState s) -> (!s, !IOState s);
  77. ChangeActivePictureDomain    ::             !PictureDomain
  78.                                     !s !(IOState s) -> (!s, !IOState s);
  79.  
  80. /*    Change the PictureDomain of the indicated window.
  81.     The first point of the PictureDomain argument MUST be to the left and above
  82.     the second point of the given PictureDomain; otherwise nothing happens.
  83.     If the new picture domain is smaller than the current minimum size of the 
  84.     window, then the minimum size will be set to the new picture domain.
  85.     The settings of the scrollbars are automatically adjusted. The window will
  86.     be resized when the new domain is smaller than the current size.
  87.     If the window is a FixedWindow, and its new size becomes larger than the
  88.     screen allows the window becomes a ScrollWindow. */
  89.  
  90. DrawInWindow                :: !WindowId ![DrawFunction] !(IOState s) -> IOState s;
  91. DrawInActiveWindow            ::             ![DrawFunction] !(IOState s) -> IOState s;
  92.  
  93. /*    Apply the list of DrawFunctions (see deltaPicture.dcl) in the given order
  94.     to the Picture of the indicated window. */
  95.  
  96. DrawInWindowFrame            :: !WindowId !(UpdateFunction s)
  97.                                     !s !(IOState s) -> (!s, !IOState s);
  98. DrawInActiveWindowFrame        ::             !(UpdateFunction s)
  99.                                     !s !(IOState s) -> (!s, !IOState s);
  100.  
  101. /*    Apply the list of DrawFunctions returned by the UpdateFunction to the
  102.     Picture of the indicated window.
  103.     The UpdateFunction has a list of visible rectangles as parameter, which
  104.     makes it possible to return a list of drawing functions that only draw in
  105.     the visible part of the window. */
  106.  
  107. WindowGetFrame                :: !WindowId !(IOState s) -> (!PictureDomain, !IOState s);
  108. ActiveWindowGetFrame        ::             !(IOState s) -> (!PictureDomain, !IOState s);
  109.  
  110. /*    Return the visible part of the Picture of the indicated window in terms
  111.     of the PictureDomain. In case the WindowId is unknown, ((0,0),(0,0)) is
  112.     returned. */
  113.  
  114. EnableKeyboard                :: !WindowId !(IOState s) -> IOState s;
  115. DisableKeyboard                :: !WindowId !(IOState s) -> IOState s;
  116. EnableActiveKeyboard        ::             !(IOState s) -> IOState s;
  117. DisableActiveKeyboard        ::             !(IOState s) -> IOState s;
  118. ChangeKeyboardFunction        :: !WindowId !(KeyboardFunction s (IOState s))
  119.                                          !(IOState s) -> IOState s;
  120. ChangeActiveKeyboardFunction::!(KeyboardFunction s (IOState s))
  121.                                          !(IOState s) -> IOState s;
  122.  
  123. /*    Enabling, disabling and changing the KeyboardFunction of the indicated window. */
  124.  
  125. EnableMouse                    :: !WindowId !(IOState s) -> IOState s;
  126. DisableMouse                :: !WindowId !(IOState s) -> IOState s;
  127. EnableActiveMouse            ::             !(IOState s) -> IOState s;
  128. DisableActiveMouse            ::             !(IOState s) -> IOState s;
  129. ChangeMouseFunction            :: !WindowId !(MouseFunction s (IOState s))
  130.                                          !(IOState s) -> IOState s;
  131. ChangeActiveMouseFunction    ::!(MouseFunction s (IOState s))
  132.                                          !(IOState s) -> IOState s;
  133.  
  134. /*    Enabling, disabling and changing the MouseFunction of the indicated window. */
  135. */
  136.  
  137. from    Window1 import
  138.     OpenWindows, CloseWindows, CloseActiveWindow, ActivateWindow, GetActiveWindow,
  139.     DrawInWindow,       DrawInWindowFrame,
  140.     DrawInActiveWindow, DrawInActiveWindowFrame,
  141.     
  142.     EnableKeyboard, DisableKeyboard, ChangeKeyboardFunction,
  143.     EnableMouse,    DisableMouse,    ChangeMouseFunction,
  144.     EnableActiveKeyboard, DisableActiveKeyboard, ChangeActiveKeyboardFunction,
  145.     EnableActiveMouse,    DisableActiveMouse,    ChangeActiveMouseFunction,
  146.     
  147.     ScrollBarChange, ChangeThumbs, ChangeScrolls,
  148.         ChangeHThumb,  ChangeVThumb,
  149.         ChangeHScroll, ChangeVScroll,
  150.         ChangeHBar,    ChangeVBar,
  151.     
  152.     ChangeUpdateFunction,       ChangePictureDomain,       ChangeWindowTitle,
  153.     ChangeActiveUpdateFunction, ChangeActivePictureDomain, ChangeActiveWindowTitle,
  154.     ChangeScrollBar,       WindowGetFrame, WindowGetPos,
  155.     ChangeActiveScrollBar, ActiveWindowGetFrame, ActiveWindowGetPos,
  156.     
  157.     ChangeWindowCursor,
  158.     ChangeActiveWindowCursor,
  159.     
  160.     IOState;
  161.